package com.gitee.wsl.test


import timber.log.Timber
import kotlin.time.TimedValue
import kotlin.time.measureTime
import kotlin.time.measureTimedValue


var traceTimes:Boolean = true

inline fun <T : Any> traceTime(name: String, block: () -> T): T {
    lateinit var result: T
    val time = measureTime {
        result = block()
    }
    if (traceTimes) {
        Timber.i ( "$name loaded in $time" )
    }
    return result
}